#ifndef _IMAGE_GEN_GENFROMDISK_
#define _IMAGE_GEN_GENFROMDISK_

#include "../../../function.h"

namespace sp::Image::Gen{

void registe_genFromDisk();

/*
    从磁盘中读取视频流
*/
class genFromDisk: public Function{
private:
    std::string path;
    char* video_ptr_head;
    char* current_video_ptr;
    int fps;
    int width;
    int height;
    cv::VideoCapture capture;
    struct timeval time_start;
    long cnt;
    long total_cnt;
public:
    genFromDisk(std::vector<std::string> v);  // std::string path, int fps, int width, int height
    genFromDisk(std::string path, char* video_ptr_head, long total_cnt, int fps, int width, int height);
    genFromDisk();
    virtual ~genFromDisk();
    static void registe();
    static Function* createObject(std::vector<std::string> params);
    static Function* createObject2();
    virtual void start();
    virtual bool waitForResource();
    virtual void process(std::vector<std::vector<Data*>>& data_input, std::vector<Data*>& data_output);
    virtual bool releaseResource();
    virtual void finish();
    // 有一个分离的处理
    virtual bool process();
    virtual void copy(Function* other);
};

};

#endif